import { useCallback, useState } from 'react'
import B from './B'

const A: React.FC = () => {
  const [num, setNum] = useState<number>(0)

  const changeNum = useCallback(() => {
    setNum(num => num + 1)
  }, [])

  return (
    <>
      <p>number: {num}</p>
      <B num={num} setNum={setNum} changeNum={changeNum}/>
    </>
  )
}

export default A
